package com.gxa.learning.core.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 课程实体类
 *
 * @Author ChenJ
 * @date 2021/12/02 14:13
 **/
@AllArgsConstructor
@NoArgsConstructor
@Data
@Table(name = "tb_course")
@ApiModel
public class Course implements Serializable {

    /**
     * 课程编号
     */
    @Id
    @Column(name = "course_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(name = "id", value = "id", dataType = "Long", example = "课程编号")
    private Long id;

    /**
     * 课程封面 图片
     */
    @Column(name = "course_cover", unique = true)
    @ApiModelProperty(name = "cover", value = "cover", dataType = "String", example = "课程封面 图片")
    private String cover;

    /**
     * 类别id 关联类别表 获取类别
     */
    @Column(name = "type_id", unique = true)
    @ApiModelProperty(name = "typeId", value = "typeId", dataType = "Long", example = "类别id 关联类别表 获取类别")
    private Long typeId;

    /**
     * 等级id 关联等级表 获取等级
     */
    @Column(name = "level_manager_id", unique = true)
    @ApiModelProperty(name = "lmId", value = "lmId", dataType = "Long", example = "等级id 关联等级表 获取等级")
    private Long lmId;

    /**
     * 课程标题
     */
    @Column(name = "course_title", unique = true)
    @ApiModelProperty(name = "title", value = "title", dataType = "String", example = "课程标题")
    private String title;

    /**
     * 课程状态 true:上架 false:下架
     */
    @Column(name = "course_status", unique = true)
    @ApiModelProperty(name = "status", value = "status", dataType = "String", example = "课程状态")
    private Boolean status;

    /**
     * 课程说明
     */
    @Column(name = "course_explain")
    @ApiModelProperty(name = "explain", value = "explain", dataType = "String", example = "课程说明")
    private String explain;

    /**
     * 课程预计完成时间
     */
    @Column(name = "course_finish_time")
    @ApiModelProperty(name = "finishTime", value = "课程预计完成时间", dataType = "Date", example = "2021-12-12 23:23:12")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date finishTime;

    /**
     * 课程的课时
     */
    @Column(name = "course_ware", unique = true)
    @ApiModelProperty(name = "ware", value = "ware", dataType = "Integer", example = "课程的课时")
    private Integer ware;

    /**
     * 课程附件
     */
    @Column(name = "course_accessory")
    @ApiModelProperty(name = "accessory", value = "accessory", dataType = "String", example = "课程附件")
    private String accessory;

    /**
     * 课程完成规则
     */
    @Column(name = "course_rule", unique = true)
    @ApiModelProperty(name = "rule", value = "rule", dataType = "String", example = "课程完成规则")
    private String rule;

    /**
     * 课程的管理员
     */
    @Column(name = "course_admin")
    @ApiModelProperty(name = "admin", value = "admin", dataType = "String", example = "课程的管理员")
    private String admin;

    /**
     * 项目id 关联培训项目
     */
    @Column(name = "project_id", unique = true)
    @ApiModelProperty(name = "projectId", value = "projectId", dataType = "Long", example = "项目id 关联培训项目")
    private Long projectId;

}
